function [util] = util_la(x,lambda,alpha)
% This function calculates the utility of a loss averse individual. It
% assumes a reference point of zero and CRRA preferences with paramater alpha. The individual is
% risk-averse over gains and risk-seeking over losses.

% x is the outcome and can be a vector

util = (x>=0).*(x.^alpha)-(x<0).*(lambda*(-x).^alpha);
% CARA
%util = (x>=0).*(alpha-alpha*exp(-alpha*x))-(x<0).*(lambda*(alpha-alpha*exp(alpha*x)));

% risk averse
%util = (1+x).^alpha;
% risk neutral
%  util = x;
